<?php
namespace app\blog\form;

use app\common\loglic\Form;

class Tag extends Form
{
    public function items($data=[])
    {
        return [
            'tag_id' => [
                'type'        => 'hidden',
                'value'       => $data['tag_id'],
            ],
            'tag_status' => [
                'type'        => 'select',
                'value'       => $data['tag_status'],
                'option'      => model('common/Attr','loglic')->status(),
                'required'    => true,
                'title'       => '状态',
                'class_row'   => 'col-2 mb-3',
            ],
            'tag_menu' => [
                'type'        => 'select',
                'value'       => intval($data['tag_menu']),
                'option'      => model('common/Attr','loglic')->group(),
                'title'       => '菜单分组',
                'class_row'   => 'col-2 mb-3',
            ],
            'tag_weight' => [
                'type'        => 'select',
                'value'       => intval($data['tag_weight']),
                'option'      => model('common/Attr','loglic')->weight(),
                'title'       => '权重',
                'class_row'   => 'col-2 mb-3',
            ],
            'tag_count' => [
                'type'        => 'number',
                'value'       => intval($data['tag_count']),
                'required'    => true,
                'title'       => '统计',
                'class_row'   => 'col-2 mb-3',
            ],
            'tag_limit' => [
                'type'        => 'number',
                'value'       => intval($data['tag_limit']),
                'required'    => false,
                'title'       => '每页数量',
                'class_row'   => 'col-2 mb-3',
            ],
            'tag_tpl' => [
                'type'        => 'text',
                'value'       => $data['tag_tpl'],
                'required'    => false,
                'title'       => '模板名',
                'class_row'   => 'col-2 mb-3',
            ],
            'tag_name' => [
                'type'        => 'text',
                'value'       => $data['tag_name'],
                'required'    => true,
                'title'       => '标签名称',
                'maxlength'   => 30,
                'class_row'   => 'col-6 mb-3',
            ],
            'tag_slug' => [
                'type'        => 'text',
                'value'       => $data['tag_slug'],
                'required'    => false,
                'title'       => '唯一标识',
                'placeholder' => '留空自动生成',
                'class_row'   => 'col-6 mb-3',
            ],
            'tag_cover' => [
                'type'        => 'image',
                'value'       => $data['tag_cover'],
                'required'    => false,
                'title'       => '竖版封面',
                'class_row'   => 'col-6 mb-3',
            ],
            'tag_slide' => [
                'type'        => 'image',
                'value'       => $data['tag_slide'],
                'required'    => false,
                'title'       => '横版封面',
                'class_row'   => 'col-6 mb-3',
                'class_label' => 'form-label',
            ],
            'tag_excerpt' => [
                'type'        => 'textarea',
                'value'       => $data['tag_excerpt'],
                'required'    => false,
                'title'       => '标签描述',
                'rows'        => 3,
                'class_row'   => 'col-6 mb-3',
                'class_label' => 'form-label',
            ],
            'tag_title' => [
                'type'        => 'textarea',
                'value'       => $data['tag_title'],
                'required'    => false,
                'title'       => 'SEO标题',
                'rows'        => 3,
                'class_row'   => 'col-6 mb-3',
                'class_label' => 'form-label',
            ],
            'tag_keywords' => [
                'type'        => 'textarea',
                'value'       => $data['tag_keywords'],
                'required'    => false,
                'title'       => 'SEO关键字',
                'rows'        => 3,
                'class_row'   => 'col-6 mb-3',
                'class_label' => 'form-label',
            ],
            'tag_description' => [
                'type'        => 'textarea',
                'value'       => $data['tag_description'],
                'required'    => false,
                'title'       => 'SEO描述',
                'rows'        => 3,
                'class_row'   => 'col-6 mb-3',
                'class_label' => 'form-label',
            ],
        ];
    }
}